Skip to content

feat: Add Kelly Criterion Bankroll Growth Tool#658

Merged
fderuiter merged 1 commit intomainfrom
feat/kelly-criterion-bankroll-gui-4295028225575539465
Mar 18, 2026
Merged

feat: Add Kelly Criterion Bankroll Growth Tool#658
fderuiter merged 1 commit intomainfrom
feat/kelly-criterion-bankroll-gui-4295028225575539465

Conversation

@fderuiter
Copy link
Owner

  • Creates FinancialMathTab and FinancialMathTool to implement Strategy Pattern.
  • Implements BankrollGrowthTool to simulate and visualize Kelly Criterion bankroll growth.
  • Updates math_explorer_gui/src/tabs/mod.rs and math_explorer_gui/src/app.rs to wire up the new tab.
  • Updates todo_gui.md to mark the feature as complete.

PR created automatically by Jules for task 4295028225575539465 started by @fderuiter

Adds the Kelly Criterion Bankroll Growth Tool to the math_explorer_gui.
It simulates multiple iterations of a fractional Kelly strategy and visualizes
the growth using `egui_plot`. The architecture adheres to the Strategy
Pattern by introducing a `FinancialMathTab` and `FinancialMathTool`.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
@google-labs-jules
Copy link
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@fderuiter fderuiter marked this pull request as ready for review March 18, 2026 23:55
Copilot AI review requested due to automatic review settings March 18, 2026 23:55
@fderuiter fderuiter merged commit c063807 into main Mar 18, 2026
1 check passed
@fderuiter fderuiter deleted the feat/kelly-criterion-bankroll-gui-4295028225575539465 branch March 18, 2026 23:55
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new Financial Math domain tab to the GUI and introduces a Kelly Criterion bankroll growth simulator/visualizer, wiring it into the app’s tab navigation and marking the roadmap item complete.

Changes:

  • Added FinancialMathTab / FinancialMathTool scaffolding and registered the new tab.
  • Implemented BankrollGrowthTool to simulate and plot bankroll trajectories for full/half/quarter Kelly.
  • Updated the GUI roadmap (todo_gui.md) to mark the bankroll growth feature as done.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
todo_gui.md Marks the Kelly “Bankroll Growth” GUI feature as completed.
math_explorer_gui/src/tabs/mod.rs Registers the new financial_math tab module.
math_explorer_gui/src/tabs/financial_math/mod.rs Adds the Financial Math tab + tool-selection scaffolding.
math_explorer_gui/src/tabs/financial_math/bankroll_growth.rs Implements the Kelly bankroll simulation UI + plotting.
math_explorer_gui/src/tabs/battery_degradation/lifetime_estimator.rs Formatting-only import cleanup.
math_explorer_gui/src/tabs/ai/attention_maps.rs Formatting-only line wrapping / layout changes.
math_explorer_gui/src/app.rs Wires FinancialMathTab into the main tab list.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +92 to +100
self.error_msg = Some(format!("Error: {:?}", e)); // e is an enum
}
}
}
(Err(e), _) => {
self.error_msg = Some(format!("Error: {:?}", e));
}
(_, Err(e)) => {
self.error_msg = Some(format!("Error: {:?}", e));
Comment on lines +6 to +13
/// A trait for sub-tools within the Financial Math tab.
pub trait FinancialMathTool {
/// Returns the name of the tool.
fn name(&self) -> &'static str;

/// Renders the tool's UI.
fn show(&mut self, ui: &mut egui::Ui);
}
let mut tool = Self {
initial_bankroll: 1000.0,
probability: 0.55,
odds: 2.0, // Decimal odds (net profit multiplier + 1, wait Kelly odds b is net profit multiplier. The Odds type in math_explorer: Odds::new(b). Let's check.)
|bankroll: &mut f64, fraction: &BankrollFraction| {
let bet_amount = *bankroll * fraction.value();
if win {
*bankroll += bet_amount * o.value();
Comment on lines +129 to +130
.add(egui::Slider::new(&mut self.odds, 0.1..=10.0).text("Net Odds (b)"))
.on_hover_text("Net profit multiplier. E.g., for +100 / even money, b = 1.0.")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants